<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "@/node_modules/uview-ui/index.scss";
</style>
<script>
	import {
		mapMutations
	} from 'vuex'
	
	import config from 'common/config.js'
	export default {
		onLaunch: function() {
			console.log('App Launch');
			// #ifdef APP-PLUS
			// App平台检测升级，服务端代码是通过uniCloud的云函数实现的，详情可参考：https://ext.dcloud.net.cn/plugin?id=2226
			console.log("plus.runtime.appid",plus.runtime.appid);
			if (plus.runtime.appid !== 'HBuilder') { // 真机运行不需要检查更新，真机运行时appid固定为'HBuilder'，这是调试基座的appid
				// uni.request({
				//     url: 'https://7a3e3fa9-7820-41d0-be80-11927ac2026c.bspapp.com/http/update', //检查更新的服务器地址
				//     data: {
				//         appid: plus.runtime.appid,
				//         version: plus.runtime.version,
				//         imei: plus.device.imei
				//     },
				//     success: (res) => {
				//         if (res.statusCode == 200 && res.data.isUpdate) {
				//             // 提醒用户更新
				//             uni.showModal({
				//                 title: '更新提示',
				//                 content: res.data.note ? res.data.note : '是否选择更新',
				//                 success: (ee) => {
				//                     if (ee.confirm) {
				//                         plus.runtime.openURL(res.data.url);
				//                     }
				//                 }
				//             })
				//         }
				//     }
				// })
				this.$request.post('sys/getAppVersion',{},'json').then((res) => {
					console.log("获取版本信息",res);
					if (res.statusCode === 200) {
						try {
							plus.runtime.getProperty(plus.runtime.appid, (info) => {
								// console.log("版本", info);
								if (info.version != res.data.data[0].content) {
									uni.navigateTo({
										url: '/pages/about/update',
									});
								}
							})
						} catch (e) {
							console.log("当前平台不支持plus，" + e);
						}
					}
				})
			}

			// 一键登录预登陆，可以显著提高登录速度
			// uni.preLogin({
			// 	provider: 'univerify',
			// 	success: (res) => {
			// 		// 成功
			// 		this.setUniverifyErrorMsg();
			// 		console.log("preLogin success: ", res);
			// 	},
			// 	fail: (res) => {
			// 		this.setUniverifyLogin(false);
			// 		this.setUniverifyErrorMsg(res.errMsg);
			// 		// 失败
			// 		console.log("preLogin fail res: ", res);
			// 	}
			// })
			// #endif
			// this.$request.post('sys/getAppVersion',{},'json').then((res) => {
			// 	console.log("获取版本信息",res);
			// 	if (res.statusCode === 200) {
			// 		try {
			// 			plus.runtime.getProperty(plus.runtime.appid, (info) => {
			// 				// console.log("版本", info);
			// 				if (info.version != res.data.data[0].content) {
			// 					console.log(1111);
			// 					uni.navigateTo({
			// 						url: '/pages/about/update',
			// 					});
			// 				}
			// 			})
			// 		} catch (e) {
			// 			console.log("当前平台不支持plus，" + e);
			// 		}
					
			// 	}
			// })
			
			
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		globalData: {
			url: config.host, //设置变量
			mallHost: config.mallHost, //设置变量
			videoList:[]
		},
		
		methods: {
			...mapMutations(['setUniverifyErrorMsg', 'setUniverifyLogin']),
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-PLUS-NVUE */
	/* uni.css - 通用组件、模板样式库，可以当作一套ui库应用 */
	@import './common/uni.css';
	@import "@/cl-uni/index.scss";

	/* H5 兼容 pc 所需 */
	/* #ifdef H5 */
	@media screen and (min-width: 768px) {
		body {
			overflow-y: scroll;
		}
	}
	/* #endif */
	/* #endif */
	/* 解决头条小程序组件内引入字体不生效的问题 */
	/* #ifdef MP-TOUTIAO */
	@font-face {
		font-family: uniicons;
		src: url('/static/uni.ttf');
	}

	/* #endif */

/* #ifndef APP-NVUE */
body {
		background: #F8F8F8;
		outline: none;
	}

	view,
	image,
	input,
	button {
		font-size: 12px;
		box-sizing: border-box;
		-moz-box-sizing: border-box;
		/* Firefox */
		-webkit-box-sizing: border-box;
		/* Safari */
	}

	.main {
		width: 90%;
		height: auto;
		display: block;
		float: left;
		margin: 0 5%;
	}


	.t1 {
		font-size: 28.5rpx;
		color: #1d0616;
	}

	.t2 {
		font-size: 30rpx;
		color: #fff;
	}

	.t3 {
		font-size: 27rpx;
		color: #fff;
	}

	.t4 {
		font-size: 27rpx;
		color: #fb1207;
	}

	.t5 {
		font-size: 27rpx;
		color: #666;
	}

	.t6 {
		font-size: 27rpx;
		color: #71b838;
	}

	.t7 {
		font-size: 27rpx;
		color: #F1C75E;
	}

	.t8 {
		font-size: 28.5rpx;
		color: #999;
	}

	.t9 {
		font-size: 28.5rpx;
		color: #fff;
	}

	.t10 {
		font-size: 33rpx;
		color: #1d0616;
	}

	.t11 {
		font-size: 30rpx;
		color: #F1C75E;
	}

	.t12 {
		font-size: 28.5rpx;
		color: #F1C75E;
	}

	.t13 {
		font-size: 28.5rpx;
		color: #fb1207;
	}

	.t14 {
		font-size: 30rpx;
		color: #1d0616;
	}

	.t15 {
		font-size: 30rpx;
		color: #fff;
		font-weight: bold;
	}

	.t16 {
		font-size: 33rpx;
		color: #71b838;
	}

	.t17 {
		font-size: 33rpx;
		color: #fb1207;
	}

	.t18 {
		font-size: 28.5rpx;
		color: #fb1207;
	}

	.t19 {
		font-size: 28.5rpx;
		color: #71b838;
	}

	.t20 {
		font-size: 33rpx;
		color: #F1C75E;
		font-weight: bold;
	}

	.t21 {
		font-size: 37.5rpx;
		color: #fff;
		font-weight: bold;
	}

	.t22 {
		font-size: 30rpx;
		color: #1d0616;
	}

	.t23 {
		font-size: 30rpx;
		color: #1d0616;
		font-weight: bold;
	}

	.t24 {
		font-size: 27rpx;
		color: #999;
	}

	.t25 {
		font-size: 32rpx;
		color: #000;
	}

	.t26 {
		font-size: 30rpx;
		color: #999;
	}

	.t27 {
		font-size: 30rpx;
		color: #fff;
		font-weight: bold;
	}

	.t28 {
		font-size: 40rpx;
		color: #1d0616;
		font-weight: bold;
	}

	.t29 {
		font-size: 26rpx;
		color: #1d0616;
	}

	/* 按钮 */
	.sure {
		width: 100%;
		height: 12vw;
		display: block;
		float: left;
		background: #007AFF;
		margin-top: 10vw;
	}

	.tuic {
		width: 80%;
		height: 14vw;
		display: block;
		float: left;
		text-align: center;
		line-height: 14vw;
		background: -webkit-linear-gradient(#F1C75E, #d4a93c);
		background: -o-linear-gradient(#F1C75E, #d4a93c);
		background: -moz-linear-gradient(#F1C75E, #d4a93c);
		background: linear-gradient(#F1C75E, #d4a93c);
		background-size: 100%;
		margin: 0 10%;
		margin-top: 10vw;
		margin-bottom: 15vw;
		border-radius: 7vw;
	}

	.tuic2 {
		width: 80%;
		height: 14vw;
		display: block;
		float: left;
		text-align: center;
		line-height: 14vw;

		/* 
				background: -moz-linear-gradient(top, #c5c4c5 0%, #ffffff 100%);

		    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#c5c4c5), color-stop(100%,#ffffff));

		    background: -webkit-linear-gradient(top, #c5c4c5 0%,#ffffff 100%);

		    background: -o-linear-gradient(top, #c5c4c5 0%,#ffffff 100%);

		    background: -ms-linear-gradient(top, #c5c4c5 0%,#ffffff 100%);

		    background: linear-gradient(to bottom, #c5c4c5 0%,#ffffff 100%); */
		/* 	background: -webkit-linear-gradient(13deg,#c5c4c5, #e9e9e9, #bbb);
		background: -o-linear-gradient(13deg,#c5c4c5, #e9e9e9, #bbb);
		background: -moz-linear-gradient(13deg,#c5c4c5, #e9e9e9, #bbb);
		background: linear-gradient(13deg,#c5c4c5, #e9e9e9, #bbb); */
		/* background-size: 100%; */
		margin: 0 10%;
		margin-top: 0;
		margin-bottom: 15vw;
		border-radius: 7vw;
		border: 1px solid #F1C75E;
		color: #F1C75E;
	}

	.tuic1 {
		width: 80%;
		height: 10vw;
		line-height: 10vw;
		display: block;
		float: left;
		text-align: center;
		margin: 2vw 10%;
		border-radius: 2vw;
		border: 1px solid #F1C75E;
	}

	.zanwu {
		width: 100%;
		height: auto;
		display: block;
		float: left;
		padding-top: 20vw;
	}

	.zanwu image {
		width: 30vw;
		height: auto;
		display: block;
		float: left;
		margin-left: 30vw;
		margin-bottom: 10vw;
	}

	.zanwu text {
		width: 100%;
		text-align: center;
		height: auto;
		display: block;
		float: left;
	}
/* #endif */
	

	/* logo配色 #eeb6b7 #ffdedc #FFBD04 #fcea6c #aab7b0 #cad1ca #8ecce5 #73c2d3 #faeff7 #d7ccea #FEFEFC #c6c6c6 #806d5c  #1d0616 */
</style>
